import numpy as np
import math as mt


def spline_interp(x: np.ndarray, y: np.ndarray):
    numPts: int = len(x)
    a = np.empty(numPts, dtype=np.float)
    b = np.empty(numPts, dtype=np.float)
    c = np.empty(numPts, dtype=np.float)
    d = np.empty(numPts, dtype=np.float)
    dy_dx = np.zeros(numPts, dtype=np.float)

    finish: bool = True
    n: int = numPts - 1

    min_seg: float = 1.0E-6
    lx = np.zeros(n + 1)
    for i in range(1, n + 1):
        lx[i] = x[i] - x[i - 1]
        if lx[i] < min_seg:
            print("曲线定义错误, x 区间过小")
            finish = False

    a[0] = 0.0
    lx[0] = 0.0

    b[0] = 2.0
    c[0] = 1.0
    d[0] = 3.0*(y[1]-y[0])/lx[1]


